<?php
namespace app\admin\controller;
use app\common\BaseController;



class Index extends BaseController
{
	public function index(){
		
		
		return view('index');
	}
	public function upload_img($type){
		$ext = explode('.', $_FILES['file']['name']);
		$ext = $ext[count($ext)-1];
		$filename = date('YmdHis').rand(100,999).'.'.$ext;
		$res = move_uploaded_file($_FILES['file']['tmp_name'], UPLOAD_PATH.$type.$filename);
		if($res)
			return ['code'=>0,'img_path'=>$type.$filename];
		else
			return ['code'=>404];
		
	}
}